# -*- coding: utf-8 -*-

from autoscrapy.plugin import goose_plugin as goose
from autoscrapy.utils import log


LOG = log.get_logging(__name__)


class crawl(object):

    def __init__(self, context):
        self._context = context
        self._plugin = goose.get_crawl()

    def fetch(self, url):
        try:
            return self._plugin.fetch(url)
        except Exception as e:
            LOG.error(" crawl fetch url %s fail", url)
            LOG.exception(" crawl fetch url occure exception %s", e)
        return None

